﻿//
// Copyright (c) 2024 BPer
//

#ifndef BPERDECODER_SRC_BPERH264DECODERSOFT2_H_
#define BPERDECODER_SRC_BPERH264DECODERSOFT2_H_

#include <bperdecoder/BPerVideoDecoder.h>
#include <bperdecoder/BPerDecoderH264.h>
#include <bperutil/sys/BPerLoadLib.h>
#include <bperutil/BPerType.h>


#if !BPer_Enable_H264Decoder_So
class BPerH264DecoderSoft2: public BPerVideoDecoder {
public:
	BPerH264DecoderSoft2();
	virtual ~BPerH264DecoderSoft2();
	void parseRtmpHeader(uint8_t *p, int32_t pLen, int32_t *pwid, int32_t *phei, int32_t *pfps);
	void init();
	int32_t decode(BPerFrame* videoFrame,BPerYuvType yuvtype,BPerDecoderCallback* pcallback);

private:
	uint8_t* m_buffer;
	int32_t m_bufLen;
private:

	void getH264RtmpHeader(uint8_t *buf, uint8_t *src, int32_t *hLen);
	BPerDecoderH264* m_decoder;
};
#endif
#endif /* BPERDECODER_SRC_BPERH264DECODERSOFT_H_ */
